<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>echars</title>
    <script src="plugins/echarts/echarts.js"></script>
</head>
<body>

<!--为ECharts准备一个具备大小的DOM-->
<div id="main" style="width: 600px;height: 400px"></div>
<script>
    //基于准备好dom,初始化echarts实例
    let myChart = echarts.init(document.getElementById("main"));

    //指定图标的配置项和数据
    let option = {
        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'value'
        },
        series: [{
            data: [120, 200, 150, 80, 70, 110, 130],
            type: 'bar',
            showBackground: true,
            backgroundStyle: {
                color: 'rgba(220, 220, 220, 0.8)'
            }
        }]
    };

    //使用刚指定的配置项和数据显示
    myChart.setOption(option);
</script>

</body>
</html>